#ifndef GTKMM_PRINTWINDOW_H
#define GTKMM_PRINTWINDOW_H

#include "CustomPrintOperation.h"
#include "PrintTable.h"
#include <memory>
#include <vector>
#include "AreaDibujo.h"
#include <pangomm.h>
#include <gtkmm.h>

class PrintFormOperation;

class PrintWindow : public Gtk::Dialog
{
private:
  //Objetos relacionados con la impresion
  Glib::RefPtr<Gtk::PageSetup> m_refPageSetup;
  Glib::RefPtr<Gtk::PrintSettings> m_refSettings;

  //Child widgets:
  Gtk::HBox hBox;
  Gtk::Button btnPageSetup;
  Gtk::Button btnPrintPreviewCirc;
  Gtk::Button btnPrintCirc;
  Gtk::Button btnPrintPreviewTable;
  Gtk::Button btnPrintTable;
  Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
  
  //guardo elementos para imprimirlos
   AreaDibujo * pDrawing;
   Circuito* circuito;
  
public:
    PrintWindow(AreaDibujo * pd, Circuito* circuito);
    virtual ~PrintWindow();
private:

    void build_main_menu();

    /*
     * Funciones auxiliares de la impresion
     */
    void print_or_preview_circ(Gtk::PrintOperationAction print_action);
    void on_printoperation_status_changed_circ(const Glib::RefPtr<CustomPrintOperation>& operation);
    void on_printoperation_done_circ(Gtk::PrintOperationResult result, const Glib::RefPtr<CustomPrintOperation>& operation);

    //Manejadores de los botones
    void on_menu_file_page_setup();
    void on_menu_file_print_preview_circ();
    void on_menu_file_print_circ();

    void print_or_preview_table(Gtk::PrintOperationAction print_action);
    void on_printoperation_status_changed_table(const Glib::RefPtr<PrintTable>& operation);
    void on_printoperation_done_table(Gtk::PrintOperationResult result, const Glib::RefPtr<PrintTable>& operation);

     //Manejadores de los botones
    void on_menu_file_print_preview_table();
    void on_menu_file_print_table();

};

#endif //GTKMM_PRINTWINDOW_H
